nanoseconds(x::Duration) = value(x)
microseconds(x::Duration) = fld(value(x), NANOSECONDS_PER_MICROSECOND)
milliseconds(x::Duration) = fld(value(x), NANOSECONDS_PER_MILLISECOND)
seconds(x::Duration) = fld(value(x), NANOSECONDS_PER_SECOND)
minutes(x::Duration) = fld(value(x), NANOSECONDS_PER_MINUTE)
hours(x::Duration) = fld(value(x), NANOSECONDS_PER_HOUR)
days(x::Duration) = fld(value(x), NANOSECONDS_PER_DAY)
weeks(x::Duration) = fld(value(x), NANOSECONDS_PER_WEEK)

Nanoseconds(x::Duration) = Nanoseconds(nanoseconds(x))
Microseconds(x::Duration) = Microseconds(microseconds(x))
Milliseconds(x::Duration) = Milliseconds(milliseconds(x))
Seconds(x::Duration) = Seconds(seconds(x))
Minutes(x::Duration) = Minutes(minutes(x))
Hours(x::Duration) = Hours(hours(x))
Days(x::Duration) = Days(days(x))
Weeks(x::Duration) = Weeks(weeks(x))

nanosecond(x::Duration) = mod(nanoseconds(x), NANOSECONDS_PER_MICROSECOND)
microsecond(x::Duration) = mod(microseconds(x), MICROSECONDS_PER_MILLISECOND)
millisecond(x::Duration) = mod(milliseconds(x), MILLISECONDS_PER_SECOND)
second(x::Duration) = mod(seconds(x), SECONDS_PER_MINUTE)
minute(x::Duration) = mod(minutes(x), MINUTES_PER_HOUR)
hour(x::Duration) = mod(hours(x), HOURS_PER_DAY)
day(x::Duration) = days(x)
week(x::Duration) = weeks(x)

Nanosecond(x::Duration) = Nanosecond(nanosecond(x))
Microsecond(x::Duration) = Microsecond(microsecond(x))
Millisecond(x::Duration) = Millisecond(millisecond(x))
Second(x::Duration) = Second(second(x))
Minute(x::Duration) = Minute(minute(x))
Hour(x::Duration) = Hour(hour(x))
Day(x::Duration) = Day(day(x))
Week(x::Duration) = Week(week(x))
